package net.eclipsemail.core.authentication.impl;

import javax.mail.Session;
import javax.mail.Store;

import com.eclipsemail.core.authentication.Auth;
import com.eclipsemail.core.authentication.Authenticable;
import com.eclipsemail.core.authentication.AuthenticationException;
import com.eclipsemail.core.authentication.impl.GMailAuthentication;

public class GMailAuthenticationFake implements Authenticable {

    private Auth auth;
    private GMailAuthentication gMailAuth;

    public GMailAuthenticationFake() {
        String login = "dev.eclipse.plugins.test@gmail.com";
        char[] pass = { 122, 120, 99, 118, 49, 50, 51, 52 };

        this.auth = new Auth(login, pass);
        this.gMailAuth = new GMailAuthentication(this.auth);
    }

    @Override
    public Auth getAuth() {
        return auth;
    }

    @Override
    public Store connect(Session session) throws AuthenticationException {
        return gMailAuth.connect(session);
    }

    @Override
    public void close() {
        gMailAuth.close();
    }

}
